package study.edumanagesystemspringboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.stereotype.Component;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import java.io.Serializable;
import java.util.Map;

/**
 * @author zouran
 * createDate：2023/12/23  17:27
 */
@Component
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "person", discriminatorType = DiscriminatorType.STRING)
@Data
@Accessors(chain = true)
public abstract class Person implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer id;

    private String name;

    private String sex;

    private Integer age;

    private String department;

    private String phone;

    /**
     * @return 人物身份
     */
    public abstract String getIdentify();

    public abstract Map<String, Object> accept(Visitor visitor);
}
